/* 
    *global console
    *FileName:index.js
    *PATH:src/router
    *Time: 2024/10/15 22:31
    *Author: zzy
*/
import {createWebHistory, createRouter} from 'vue-router'


const routes = [
    {
        path: '/', component: () => import('@/views/Layout/Index.vue'),
        name: "index",
        meta: {
            title: "index"
        },
        children: [
            // aside
            {
                path: '/testcase', components: {
                    aside: () => import('@/views/TestCase/Index.vue'),
                    main: () => import('@/views/WorkSpace/Index.vue')
                },
            },
            {
                path: '/', component: () => import('@/views/WorkSpace/Index.vue'),
                redirect: "/refactor",
            },
            {
                // 遥控界面
                path: '/control', components: {
                    aside: () => import('@/views/Control/components/Aside.vue'),
                    main: () => import('@/views/Control/Index.vue')
                },
                name: "control",
                meta: {keepAlive: true, title: "遥控"}
            },
            {
                // 遥测界面
                path: '/telemetry', components: {
                    aside: () => import('@/views/Telemetry/components/Aside.vue'),
                    main: () => import('@/views/Telemetry/Index.vue')
                },
                meta: {keepAlive: true, title: "遥测"}
            },
            {
                // 流程界面
                path: "/process", components: {
                    main: () => import('@/views/process/Index.vue'),
                },
                meta: {keepAlive: true, title: "流程"}
            },
            {
                // 流程界面
                path: "/chart", components: {
                    main: () => import('@/views/Chart/Index.vue'),
                },
                meta: {keepAlive: true, title: "chart"}
            },
            {
                // 流程界面
                path: "/history", components: {
                    main: () => import('@/views/History/Index.vue'),
                },
                meta: {keepAlive: true, title: "history"}
            },
            {
                path: "/test", components: {
                    main: () => import('@/views/test.vue')
                }
            },
            {
                path: "/engineering_data", components: {
                    main: () => import('@/views/EngineerData/Index.vue')
                },
                name: "engineering_data",
                meta: {keepAlive: true, title: "工程遥测下传"}
            },
            {
                path: "/data_parser", components: {
                    main: () => import('@/views/DataParser/Index.vue')
                },
                name: "data_parser",
                meta: {keepAlive: true, title: "工程遥测解析"}
            },
            {
                path: "/refactor", components: {
                    main: () => import('@/views/refactor/Index.vue')
                },
                name: "refactor",
                meta: {keepAlive: true, title: "光学头重构"}
            },
            {
                path: "/buffer_view", components: {
                    main: () => import('@/views/BufferView/Index.vue')
                },
                name: "buffer_view",
                meta: {keepAlive: true, title: "二进制文件预览"}
            },
            {
                path: "/rtc", components: {
                    main: () => import("@/WebRTC/Index.vue")
                }
            },
            {
                path: "/rcv", components: {
                    main: () => import("@/WebRTC/receive.vue")
                }
            },
            {
                path: "/p2p2", components: {
                    main: () => import("@/WebRTC/comps/mP2p.vue")
                }
            },
            {
                path: "/ptest2", components: {
                    main: () => import("@/WebRTC/Index.vue")
                }
            },
        ],

    },
    {
        path: "/ptest", component:
            () => import("@/WebRTC/comps/test.vue")

    },
    {
        path: "/p2p", component: () => import("@/WebRTC/comps/mP2p.vue")

    },
    {
        path: "/TelemetryWindow", component: () => import("@/views/Telemetry/TelemetryWindow.vue")
    }
]

export const router = createRouter({
    history: createWebHistory(),
    routes,
})
